﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <Color x:Key="bgButtonColor">#FFFFFFFF</Color>
    <Color x:Key="bgButtonColorHL">#FF3399ff</Color>

    <SolidColorBrush x:Key="bgButtonBrush" Color="{StaticResource bgButtonColor}"/>
    <SolidColorBrush x:Key="bgButtonBrushHL" Color="#FF009DEF"/>
    <SolidColorBrush x:Key="ButtonForegroundBrush" Color="#FF000000"/>

    <Style TargetType="{x:Type Button}">
        <!--<Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>-->
        <Setter Property="Background" Value="{StaticResource bgButtonBrush}"/>
        <Setter Property="Foreground" Value="{StaticResource ButtonForegroundBrush}"/>
        <Setter Property="BorderBrush" Value="{StaticResource bgButtonBrush}"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="MinWidth" Value="75"/>
        <Setter Property="MinHeight" Value="25"/>
        <Setter Property="Padding" Value="0,0,0,0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Border x:Name="ContentContainer" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition From="MouseOver" GeneratedDuration="0" To="Normal">
                                        <Storyboard>
                                            <ColorAnimation Duration="0:0:0.4" To="{StaticResource bgButtonColor}" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)" Storyboard.TargetName="ContentContainer"/>
                                        </Storyboard>
                                    </VisualTransition>
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.4" To="{StaticResource bgButtonColorHL}" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)" Storyboard.TargetName="ContentContainer"/>

                                        <!--<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)" Storyboard.TargetName="ContentContainer">
                                                <EasingColorKeyFrame KeyTime="0" Value="{StaticResource bgColor}"/>
                                                <EasingColorKeyFrame KeyTime="0:0:0.3" Value="{StaticResource bgColorHL}"/>
                                                </ColorAnimationUsingKeyFrames>-->
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed"/>
                                <VisualState x:Name="Disabled"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsKeyboardFocused" Value="true">
                            <!--<Setter Property="BorderStyle" TargetName="ContentContainer" Value="RaisedFocused"/>-->
                        </Trigger>
                        <Trigger Property="IsDefaulted" Value="true">
                            <!--<Setter Property="BorderStyle" TargetName="ContentContainer" Value="RaisedFocused"/>-->
                        </Trigger>
                        <Trigger Property="IsPressed" Value="true">
                            <!--<Setter Property="BorderStyle" TargetName="ContentContainer" Value="RaisedPressed"/>-->
                        </Trigger>
                        <Trigger Property="ToggleButton.IsChecked" Value="true">
                            <!--<Setter Property="BorderStyle" TargetName="ContentContainer" Value="RaisedPressed"/>-->
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>